<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>供应商列表</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function searchForm(){
			$("#searchForm").submit();
	    	return false;
	    }
		
		function getCheckVal(){
			var idsArray = new Array();
			$.each($("input[name='chk']"),function(){
				if(this.checked){
					var id = $(this).val();
	                idsArray.push(id);
				}
			});
			//console.log(idsArray);
            return idsArray;
		}
		
		function clearCheck(){
			$("input[type='checkbox']").prop("checked", false);
		}
		$(function(){
			$("#allChk").click(function(){
				if(this.checked){
					$("input[name='chk']").prop("checked", true);
				}else{
					$("input[name='chk']").prop("checked", false);
				}
			});
		});
	</script>
</head>
<body>
	
	<form:form id="searchForm" action="${ctx}/zx/proSupplier/mySupplierList?lzdId=${lzdId}&sectionId=${sectionId}" method="post" class="breadcrumb form-search">
		<ul class="ul-form">
			<li>
				<label>单位名称：</label>
				<input name="name" value="${supplier.name}" maxlength="50" class="input-medium zx-input" style="width: 150px"/>
			</li>
			<li>
				<label>联络人：</label>
				<input name="contacts" value="${supplier.contacts}" maxlength="50" class="input-medium zx-input" style="width: 150px"/>
			</li>
			<li>
				<label>联系电话：</label>
				<input name="phone" value="${supplier.phone}" maxlength="50" class="input-medium zx-input" style="width: 150px"/>
			</li>
			<li><label>项目名称：</label>
				<input name="proName" htmlEscape="false" value="${supplier.proName}" maxlength="100" class="input-medium zx-input" style="width: 150px"/>
			</li>
			<li><label>项目编号：</label>
				<input name="proNo" htmlEscape="false" value="${supplier.proNo}" maxlength="100" class="input-medium zx-input" style="width: 150px"/>
			</li>
			<li class="btns">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return searchForm();"/>
			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th><input type="checkbox" name="allChk" id="allChk">全选/反选</th>
				<th>单位名称</th>
				<th>联络人</th>
				<th>联系电话</th>
				<th>联系地址</th>
				
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${slist}" var="supplier">
			<tr>
				<td>
					<c:choose>
						 <c:when test="${supplier.fenPeiFlag eq '1'}"> 	
						 	<font color="blue">已设置</font>
						 </c:when>
						 <c:otherwise>
						 	<input type="checkbox" value="${supplier.id}" name="chk">
						 </c:otherwise>
					</c:choose>
					
				</td>
				<td>
					${supplier.name}
				</td>
				<td>
					${supplier.contacts}
				</td>
				<td>
					${supplier.phone}
				</td>
				<td>
					${supplier.address}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	
</body>
</html>